package com.user;

import com.dbmanager.DbManager;

public class User {
	String username;
	String email;
	String pwd;
	public User(String ur,String email,String pwd) {
			this.username = ur;
			this.email =email;
			this.pwd = pwd;
			
	}
	public boolean saveUser(){
	String sql="INSERT INTO `test`.`user` VALUES ('" +
			 this.username+
			"', '" +
			this.email+
			"', '" +
			this.pwd +
			"');";

		DbManager db = new DbManager();
		if(db.insert(sql))
			return true;
		else
			return false;
	}
	public boolean checkUser() {
		
		String sql="SELECT * FROM test.user where( USER_NAME='" +
				this.username +
				"' && EMAIL='" +
				this.email +
				"' && PASSWORD='" +
				this.pwd +
				"');";

			DbManager db = new DbManager();
			if(db.select(sql))
				return true;
			else
				return false;
	}
}
